package com.fengxing.ams.web.facade.mouble.task;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

public interface ITaskDAO extends PagingAndSortingRepository<TaskVO, Integer>, JpaSpecificationExecutor<TaskVO>  {

	@Query(value = "SELECT * FROM zyt_sys_task WHERE task_status=0 LIMIT 0,1", nativeQuery=true)
	TaskVO getTask();

	@Modifying
	@Query(value = "update zyt_sys_task set task_status=:status WHERE id=:id", nativeQuery=true)
	void updateStatus(@Param("id")Integer id, @Param("status")Integer status);

}
